<div class="content-wrapper">
    <section class="content-header">
        <?=$this->partial('layout/breadcrumb')?>

        <h1 class="pull-right">
            <a href="<?=$this->url('finance-payable');?>" class="btn btn-default btn-sm"><i class="fa fa-arrow-left"></i> <?=$this->translate('返回应付账款列表')?></a>
            <?=$this->HelpUrl('financePayableLog')?>
        </h1>
    </section>

    <section class="content">

        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><?=$this->translate('付款信息')?></h3>
                    </div>

                    <div class="box-body">
                        <div class="row">
                            <div class="col-xs-3 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('采购单号')?>：</b><?=$this->escapeHtml($this->payableInfo->getPOrderSn());?>
                                </div>
                            </div>

                            <div class="col-xs-3 form-group">
                                <div class="col-sm-12">
                                    <b><?=$this->translate('应付金额')?>：</b><?=$this->erpCurrencyFormat($this->payableInfo->getPaymentAmount());?>
                                </div>
                            </div>

                            <div class="col-xs-3 form-group">
                                <div class="col-sm-12">
                                    <b class="text-green"><?=$this->translate('已付金额')?>：</b><?=$this->erpCurrencyFormat($this->payableInfo->getFinishAmount());?>
                                </div>
                            </div>

                            <div class="col-xs-3 form-group">
                                <div class="col-sm-12">
                                    <b class="text-danger"><?=$this->translate('未付金额')?>：</b><?=$this->erpCurrencyFormat(($this->payableInfo->getPaymentAmount() - $this->payableInfo->getFinishAmount()));?>
                                </div>
                            </div>
                        </div>

                        <div class="box-header">
                            <h4 class="box-title"><?=$this->translate('付款记录')?></h4>
                        </div>
                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover">
                                <thead>
                                <tr>
                                    <th width="10%"><?=$this->translate('付款时间')?></th>
                                    <th width="10%"><?=$this->translate('付款金额')?></th>
                                    <th width="15%"><?=$this->translate('付款人')?></th>
                                    <th width="10%"><?=$this->translate('付款凭证')?></th>
                                    <th width="30%"><?=$this->translate('付款备注')?></th>
                                    <th width="10%"><?=$this->translate('操作人')?></th>
                                    <th width="15%"><?=$this->translate('操作时间')?></th>
                                </tr>
                                </thead>

                                <?php if($this->payableLogList) foreach ($this->payableLogList as $log) { ?>
                                <tr>
                                    <td><?=date("Y-m-d", $log->getPayLogPaytime())?></td>
                                    <td><?=$this->erpCurrencyFormat($log->getPayLogAmount())?></td>
                                    <td><?=$this->escapeHtml($log->getPayLogUser())?></td>
                                    <td>
                                        <?php if($log->getPayFile()) { ?>
                                        <a href="<?=$this->basePath($log->getPayFile())?>" title="<?=$this->translate('点击查看')?>" target="_blank"><i class="fa fa-picture-o"></i></a>
                                        <?php } else echo $this->translate('无') ?>
                                    </td>
                                    <td><?=$this->escapeHtml($log->getPayLogInfo())?></td>
                                    <td><?=$this->escapeHtml($log->getOneAdmin()->getAdminName())?></td>
                                    <td><?=date("Y-m-d H:i:s", $log->getPayLogAddtime())?></td>
                                </tr>
                                <?php } ?>
                            </table>
                        </div>

                    </div>

                </div>


            </div>
        </div>

    </section>

</div>